package com.iotimc.networklibrary.service;

import com.alibaba.fastjson.JSONObject;
import com.iotimc.networklibrary.entity.BaseEntity;
import com.iotimc.networklibrary.entity.Result;
import com.iotimc.networklibrary.entity.Result2;

import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import retrofit2.http.Url;

/**
 * Created by david on 2017/10/11.
 * @author  david
 */

public interface SimpleService {
    @POST
    Observable<BaseEntity<Result>> post(@Url String url,@Body Map map);


    @POST
    Observable<BaseEntity<Result2>> post2(@Url String url,@Body Map map);


    @POST
    Observable<BaseEntity> post3(@Url String url,@Body Map map);

    @POST
    Observable<BaseEntity> postObject(@Url String url,@Body Object obj);

    @GET
    Observable<BaseEntity<Result>> get(@Url String url,@Query("json") String json);

    @GET
    Observable<BaseEntity<Result2>> get2(@Url String url, @Query("json") String json );


    @GET
    Observable<JSONObject> get3(@Url String url, @QueryMap Map<String,String> map);

}
